package com.zwy.linear;

/*
    单链表节点
 */
public class SLNode implements Node {
    private Object element;
    private SLNode next;

    public SLNode() {

    }

    public SLNode(Object element, SLNode next) {
        this.element = element;
        this.next = next;
    }
    public SLNode getNext(){
        return next;
    }
    public void setNext(SLNode next){
        this.next=next;
    }

    /**************** Methods of  Node Interface *******************/
    @Override
    public Object getData() {
        return element;
    }

    @Override
    public void setData(Object obj) {
        element=obj;
    }
}
